package project02.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.Version;
import javax.jdo.annotations.VersionStrategy;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
@Version(strategy = VersionStrategy.VERSION_NUMBER, column = "version")
public class DateData implements Serializable {

    private static final long serialVersionUID = 1L;

    // データID (ユーザID+ 日付)
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private String dataId;

    // ユーザID
    @Persistent
    private String userId;

    // 登録年
    @Persistent
    private String year;

    // 登録月
    @Persistent
    private String month;

    // 登録日
    @Persistent
    private String date;

    // 出勤時刻
    @Persistent
    private Date goToWork;

    // 出勤時刻入力区分(1:アプリより入力 / 2:手入力(修正))
    @Persistent
    private String gtwFlg;

    // 退勤時刻
    @Persistent
    private Date goHome;

    // 退勤時刻入力区分(1:アプリより入力 / 2:手入力(修正))
    @Persistent
    private String ghFlg;

    @Persistent
    private Long version = 1L;

    /**
     * Returns the key.
     *
     * @return the key
     */
    public String getDataId() {
        return dataId;
    }

    /**
     * Sets the key.
     *
     * @param key
     *            the key
     */
    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    /**
     * Returns the version.
     *
     * @return the version
     */
    public Long getVersion() {
        return version;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getMonth() {
        return month;
    }

    public void setMonth(String month) {
        this.month = month;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public Date getGoToWork() {
        return goToWork;
    }

    public void setGoToWork(Date goToWork) {
        this.goToWork = goToWork;
    }

    public String getGtwFlg() {
        return gtwFlg;
    }

    public void setGtwFlg(String gtwFlg) {
        this.gtwFlg = gtwFlg;
    }

    public Date getGoHome() {
        return goHome;
    }

    public void setGoHome(Date goHome) {
        this.goHome = goHome;
    }

    public String getGhFlg() {
        return ghFlg;
    }

    public void setGhFlg(String ghFlg) {
        this.ghFlg = ghFlg;
    }
}
